home *** CD-ROM | disk | FTP | other *** search
- Here we go, the Copper disassembler.
-
- Dim clist.w(500,1) ;set up an array to hold the Coplist
- ;500 instructions should certainly be enough
-
- BLITZ
-
- ;Set up all slices/displays and CustomCops/Colsplits here, as you would
- ;use them in your game
-
- gosub C_store; stores contents of Copper List in array
-
- AMIGA
-
- ;Set up a screen (I leave this to you)
- ;and have a look at it
-
- gosub C_disasm; interprets and prints out
-
- End
-
- .C_store
- numcop=0
- For i=0 to CopLen step 4
- adr.l=CopLoc+i
- clist(numcop,0)=Peek.w(adr):clist(numcop,1)=Peek.w(adr+2)
- numcop+1
- Next
- Return
-
- Function h${i}
- Function Return Left$(4,hex$(i))
- End Function
-
- .C_disasm
- For i=0 to numcop-1
- If clist(i,0)&1=0;Move Instruction
- DA=clist(i,0)&511
- RD=clist(i,1)
- Nprint i*4," Move ",h{DA}," #"h{RD}
- Else;Wait or Skip Instruction
- VP=clist(i,0)ASR8:HP=(clist(i,0)&254)ASL1
- VE=(clist(i,1)ASR8)&127:HP=(clist(i,1)&254)ASL1
- If clist(i,1)&1=0;Wait Instruction
- Nprint i*4," Wait(",HP,",",VP,")("HE,",",VE,")"
- Else
- NPrint i*4," Skip(",HP,",",VP,")("HE,",",VE,")"
- Endif
- Endif
- Next
-
- And there we have it. I'd check the h Function - it is intended to give
- neat hex output
-
- Anyway, the output looks something like
-
- 0 Wait(0,44)(255,255)
- 4 Move 180 #fff
- etc.
-
- The Wait means that the Copper waits until the video beam reaches the
- coordinates (0,44) after being logically AND ed with the mask (255,255)
- It then Pokes he value fff into the Register $180 (which I believe is
- the address for Colour 0 on the ECS chipset.
-
- To change the data being poked in Poke the new word into the address
- CopLoc+4(figure on left of disasm output)+2(1 word)
-
- i.e. Poke.w CopLoc+6,$ff0 would change Colour 0 to Yellow.
-
- The typical Copper list will have a Wait at the top of each Slice, then
- a lot of Pokes into the Colour Table, Sprite Registers and BPLMods and
- so on, all of which are listed in the back of the Blitz manual.
- To change the Y value for waits, Poke the new y as a byte into the
- address given by CopLoc+number on left. This can be used to e.g. move a
- ColSplit up and down the screen, but make sure that all waits are still
- in strict numerical order of y values.
-
- Happy Poking
- Mike Cooper
-
-
-
-
-
-